home *** CD-ROM | disk | FTP | other *** search
/ The 640 MEG Shareware Studio 2 / The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO / editor / 3_qtips.zip / TECH13.MSG < prev    next >
Text File  |  1992-09-21  |  7KB  |  149 lines

  1.               A QEdit Tip from the SemWare Technical Support Staff
  2.  
  3.                            .. QEdit v2.15 Commands ..
  4.  
  5.         Have you ever wanted to adjust some of your settings
  6.         temporarily?  Have you wanted to turn off the sound while
  7.         performing a repeated find command?  Have you wanted to find the
  8.         decimal code for a character?  QEdit Advanced v2.15 lets you
  9.         accomplish these tasks and more!  These additional general and
  10.         advanced macro commands increase the power of QEdit.  The
  11.         following is a list of the commands added to QEdit in version
  12.         2.15 with a brief description of each, plus several examples.
  13.  
  14.         General Commands:
  15.         ~~~~~~~~~~~~~~~~
  16.         AsciiChart - Displays a scrollable ASCII chart on the screen.
  17.  
  18.         ListFiles -  Displays a list of the currently loaded files. To
  19.             switch to another file, move the cursor to the appropriate
  20.             file and press <Enter>. To resume editing the current file,
  21.             press <Escape>.
  22.  
  23.         FirstNonWhite -  Intended as a replacement and/or supplement to
  24.             the BegLine command. Places the cursor at the first
  25.             non-white character on the line, or column 1 if the line
  26.             doesn't have any non-white characters. "White" characters
  27.             are tabs or spaces. A useful macro would be:
  28.  
  29.                 Home MacroBegin BegLine JTrue done: FirstNonWhite done:
  30.  
  31.             (Explanation: If already at the start of a line, go to the
  32.             first non-white character on the line; otherwise, if not
  33.             already at the start of a line, go to the start of the
  34.             line.)
  35.  
  36.         Advanced Macro Commands:
  37.         ~~~~~~~~~~~~~~~~~~~~~~~
  38.         The following commands, intended primarily for QEdit macro
  39.         writers, are designed to simplify the writing of certain kinds
  40.         of macros.  This group of macro commands forces the indicated
  41.         mode or setting.  If the setting is already in that condition,
  42.         they set QEdit's result code to TRUE; otherwise, they set it to
  43.         FALSE.
  44.  
  45.         In some cases, a macro can behave differently based on the
  46.         currently set QEdit modes.  The following three commands give
  47.         some control in establishing the proper environment so that
  48.         your macro will always work as intended.
  49.  
  50.         SetInsMode - Sets Insert mode on. To set Insert mode "off" (that
  51.             is, set overwrite mode "on"), do the following: SetInsMode
  52.             ToggleInsert
  53.  
  54.         SetAutoIndentMode - Sets AutoIndent mode "on". To set AutoIndent
  55.             mode off, do the following: SetAutoIndentMode ToggleIndent
  56.  
  57.         SetWordWrapMode - Sets WordWrap mode "on". To set WordWrap mode
  58.             off, do the following: SetWordWrapMode ToggleWordWrap
  59.  
  60.         The Find command sounds a tone when the search string cannot be
  61.         found. This can be irritating in the case of a long-running
  62.         macro that may possibly execute hundreds of finds that fail. The
  63.         following commands allow you to selectively turn the sound "on"
  64.         and "off".
  65.  
  66.         SetSoundOn - Sets sound "on".
  67.  
  68.         SetSoundOff - Sets sound "off".
  69.  
  70.         Most macros execute dozens of QEdit commands, sometimes hundreds
  71.         of times. This can cause the screen to flash rapidly as the
  72.         macro runs. Not only is this disconcerting to watch, it actually
  73.         decreases the speed of some macros. The following commands allow
  74.         you to temporarily suspend or resume screen updating, while a
  75.         macro is running.
  76.  
  77.         SetScreenOn - Turns screen updating "on".
  78.  
  79.         SetScreenOff - Turns screen updating "off". You must turn screen
  80.             updating back on before your macro prompts for input, or if
  81.             there is some output from the macro that you want displayed
  82.             on the screen.
  83.  
  84.         NOTE: QEdit will AUTOMATICALLY turn screen updating back on when
  85.         the macro has finished executing. Thus, it is not necessary to
  86.         issue the SetScreenOn  command at the end of the macro.
  87.  
  88.         Many times, it would be nice for a macro to force a few
  89.         settings, do its assigned task, and then restore the original
  90.         settings. The following commands allow you to do just that. Note
  91.         that each time SaveSettings is executed, the previous settings
  92.         saved with SaveSettings are overwritten.
  93.  
  94.         SaveSettings - Saves the current settings of: Insert,
  95.             AutoIndent, WordWrap, Sound, and Screen Updating.
  96.  
  97.         RestoreSettings - Restores the saved settings listed above.
  98.  
  99.         The following commands set QEdit's result code to TRUE or FALSE
  100.         based on the condition being tested. These commands make certain
  101.         types of macro tests easier and more reliable.
  102.  
  103.         isBegLine - Returns TRUE if the cursor is at column 1;
  104.             otherwise, FALSE is returned.
  105.  
  106.         isEndLine - Returns TRUE if the cursor is past the last
  107.             non-white character on the current line; otherwise, FALSE is
  108.             returned, including the case when the cursor is on an empty
  109.             line.
  110.  
  111.         isEmptyLine - Returns TRUE if the current line is empty or
  112.             contains only white space; otherwise, FALSE is returned.
  113.  
  114.         isLastLine - Returns TRUE if the cursor is on the last line of
  115.             the currently edited file; otherwise, FALSE is returned.
  116.  
  117.         isFirstLine - Returns TRUE if the cursor is on the first line of
  118.             the currently edited file; otherwise, FALSE is returned.
  119.  
  120.         isCursorInBlock - Returns TRUE if the cursor is inside a marked
  121.             block; otherwise, FALSE is returned.
  122.  
  123.         To demonstrate how these concepts tie together, consider the
  124.         following simple macro to delete all the blank lines in a marked
  125.         block. The cursor should be at the beginning of the block when
  126.         the macro is invoked.
  127.  
  128.         ^f9  MacroBegin
  129.              SetScreenOff                  * turn off screen for speed
  130.         begin:
  131.              isCursorInBlock jFalse done:  * exit if not in block
  132.              isEmptyLine     jFalse next:  * skip if not empty line
  133.              isLastLine      jTrue  last:  * special handling for last
  134.                                            * line
  135.              DelLine         jump  begin:  * delete empty lines
  136.         next:
  137.              CursorDown      jTrue begin:  * try next line
  138.              jump done:                    *
  139.         last:
  140.              DelLine                       * delete the last line
  141.         done:                              * that's all, folks!
  142.  
  143.         Matthew Giles (SemWare Technical Support)
  144.  
  145.         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  146.         Did you miss some of the previous Tips?  Don't worry, you can
  147.         download QEdit Tips 1-13 (Filename: ALLQTIPS.ZIP) on the SemWare
  148.         Support BBS (404-641-8968).
  149.